﻿
using PipeDetection.Model;
using PipeDetection.Repository;
using Sunny.UI;
using Sunny.UI.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PipeDetection.UI
{
    public static class Globel
    {
        public static PipeNetArea pipeNetArea;
        public static PipeSection pipeSection;
        public static PipeSectionInspection pipeSectionInspection;

        public static PipeNetAreaRepository PipeNetAreaRepository = new PipeNetAreaRepository();
        public static PipeSectionRepository PipeSectionRepository = new PipeSectionRepository();
        public static PipeSectionInspectionRepository pipeSectionInspectionRepository=new PipeSectionInspectionRepository();
        public static DefectCatalogRepository DefectCatalogRepository = new DefectCatalogRepository();
        public static DefectOservationsRepository DefectOservationsRepository = new DefectOservationsRepository();
        /// <summary>
        /// 打开指定窗体，并获取结果
        /// </summary>
        /// <param name="owener"></param>
        /// <param name="frm"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static bool GetDlgResult(Form owener, Form frm, out object result)
        {
            frm.TopLevel = true;
            if (frm.ShowDialog(owener) == DialogResult.OK)
            {
                result = frm.Tag as object;
                return true;
            }
            result = null;
            return false;
        }
      
    }
}
